﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ListPage.ascx.cs" Inherits="Workflow.Alerts.Sublayouts.ListPage" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<br />
<div class="contentHeader">
    <h1 class="h1PageTitle floatLeft">
        <asp:Label ID="ListName" runat="server" Text="List Page"></asp:Label>
    </h1>
    <ul class="tabs tag_tabs floatRight" id="ctrlTabs">
        <li><a href="#TabContent1">Lijstweergave</a></li>
        <li><a href="#TabContent2">Kaart</a></li>
    </ul>
</div>
<div class="clear">
</div>
<div id="TabContent1">
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowSorting="True"
        EnableEmbeddedBaseStylesheet="False" EnableEmbeddedSkins="False" CssClass="mainList tag_mainList"
        EnableViewState="False" OnExcelExportCellFormatting="RadGrid1_ExcelExportCellFormatting"
        OnItemCommand="RadGrid1_ItemCommand" OnSortCommand="RadGrid1_SortCommand" 
        OnGridExporting="RadGrid1_GridExporting" 
        onitemdatabound="RadGrid1_ItemDataBound">
        <ExportSettings HideStructureColumns="true" Excel-Format="Html" ExportOnlyData="true"
            IgnorePaging="true" />
        <ClientSettings EnableRowHoverStyle="true" EnablePostBackOnRowClick="true">
            <Selecting AllowRowSelect="True"></Selecting>
            <ClientEvents OnRowClick="RowClick" OnRowCreated="RowCreated" />
        </ClientSettings>
        <SortingSettings EnableSkinSortStyles="true" />
        <MasterTableView DataKeyNames="id" ClientDataKeyNames="id">
            <Columns>
                <telerik:GridTemplateColumn UniqueName="colStatus" Visible="false" SortExpression=""
                    ShowSortIcon="false">
                    <ItemTemplate>
                        <div class="itemStatus tag_itemStatus">
                            <%#((Workflow.Alerts.WorkflowEnums.Status)Eval("currentStatus")).ToString() %>
                        </div>
                        <div class="itemExpired tag_itemExpired">
                        </div>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <%--  REVIEW --%>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="colUnselect" HeaderText="Goedkeuren"
                    CommandName="Unselect" DataTextField="id" Visible="false" ButtonCssClass="unselect">
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="colApprove" HeaderText="Goedkeuren"
                    CommandName="Approve" DataTextField="id" Visible="false" ButtonCssClass="approve">
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="colPartApprove" HeaderText="Gedeeltelijk goedkeuren"
                    CommandName="PartiallyApprove" Visible="false" ButtonCssClass="partApprove">
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="colReject" HeaderText="Afkeuren"
                    CommandName="Reject" Visible="false" ButtonCssClass="deny">
                </telerik:GridButtonColumn>
                <%--ACCEPT/DECLINE  --%>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="colAccept" HeaderText="Akkoord"
                    CommandName="Accept" DataTextField="id" Visible="false" ButtonCssClass="accept">
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="colPartAccept" HeaderText="Gedeeltelijk goedkeuren"
                    CommandName="PartAccept" Visible="false" DataTextField="id" ButtonCssClass="partAccept">
                    </telerik:GridButtonColumn>
                <telerik:GridButtonColumn ButtonType="PushButton" UniqueName="colDecline" HeaderText="Niet akkoord"
                    CommandName="Decline" DataTextField="id" Visible="false" ButtonCssClass="decline">
                </telerik:GridButtonColumn>
                <%-- SEND  --%>
                <telerik:GridTemplateColumn UniqueName="colSend" Visible="false" SortExpression="">
                    <ItemTemplate>
                        <asp:CheckBox ID="itemChkbox" runat="server" CssClass="checkBoxLabel" Text=" "></asp:CheckBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn UniqueName="id" Visible="false" DataField="id" SortExpression="">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="currentStatus" Visible="false" DataField="currentStatus"
                    SortExpression="">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <div class="footerButtonContainer">
        <div class="filterButton">
            <input id="ShowFilter" type="button" runat="server" value="Filter" class="filter" />
        </div>
        <div class="floatRight">
            <asp:Button ID="btnSave" runat="server" Text="Aanpassingen opslaan" OnClick="btnSave_Click"
                Visible="false" CssClass="floatLeft styledButton styledButton150 js_saveList" />
            <asp:Button ID="btnExcel" runat="server" CssClass="iconButton buttonExportExcel"
                Text="Export" OnClick="btnExcel_Click" />
            <input id="Button1" type="button" class="iconButton buttonPrint" value="Print" onclick="window.print()" />
        </div>
        <div id="SelectionButtons" runat="server" visible="false">
            <asp:Button ID="btnDeleteSelect" runat="server" class="floatLeft styledButton styledButton150"
                Text="Selectie verwijderen" OnClick="btnDeleteSelect_Click" />
            <asp:Button ID="btnSendSelected" runat="server" class="floatLeft styledButton styledButton150 js_saveList2"
                Text="Selectie verzenden" OnClick="btnSendSelected_Click" />
            <asp:Button ID="btnSendAll" runat="server" class="floatLeft styledButton styledButton150"
                Text="Alles verzenden" OnClick="btnSendAll_Click" />
        </div>
        <div id="InvoiceButtons" runat="server" visible="false" class="invoiceBtns">
            <asp:Button ID="btnSendSelectedInvoice" runat="server" class="floatLeft styledButton styledButton200 js_saveList2"
                Text="Selectie factureren" OnClick="btnSendSelectedInvoice_Click" />
            <asp:Button ID="btnSendAllInvoice" runat="server" class="floatLeft styledButton styledButton200"
                Text="Alles factureren" OnClick="btnSendAllInvoice_Click" />
                <asp:Button ID="btnGetGedeeltelijkHerstelInvoice" runat="server" class="floatLeft styledButton styledButton200"
                Text="Gedeeltelijk herstel" OnClick="btnGetPartiallyAccepInvoice_Click" style="display: none;" />
                <asp:Button ID="Button2" runat="server" class="floatLeft styledButton styledButton200"
                Text="Gedeeltelijk herstel naar archief" OnClick="btnSendPartiallyAccepToArchive_Click"  />
                
                <!-- TODO: btnGetGedeeltelijkHerstelInvoice is temporarily disabled because it does not fit in the design -->
                
        </div>
    </div>
    <asp:Label ID="excellabel" runat="server"></asp:Label>

    <script type="text/javascript">
        workflow.alertList.Init('div.tag_mainList')

        function RowClick(sender, args) { }
        function RowCreated(sender, args) { }

        function reviewClick() {
            alert('Toon buttons voor beoordelings proces.');
        }
    </script>

</div>
<input type="hidden" runat="server" id="DetailsPath" />
<input id="MapXml" type="hidden" runat="server" class="tag_mapXML" />
<input id="MunicipalityName" type="hidden" runat="server" />

<script type="text/javascript">
    workflow.review.Init("div.tag_review", document.getElementById("<%= MunicipalityName.ClientID %>").value)
</script>

<div id="TabContent2" class="mapViewLarge tag_mapviewLarge">
    <div id="Map" class="map mapFullContent">
    </div>

    <script type="text/javascript">
        /* <![CDATA[ */
        var oMap
        /* ]]> */
    </script>

</div>

<script type="text/javascript">
    (function() {
        var tabs = new workflow.tabs('ul.tabs a')
        tabs.Init()
    })()
</script>

<asp:PlaceHolder ID="phHideMap" runat="server" Visible="false">
<script type="text/javascript">
    (function() {
    jQuery('#TabContent2').hide();
    jQuery('#ctrlTabs').hide();
    })()
</script>

</asp:PlaceHolder>

<div id="FilterPanel" class="filterPanel">
    <iframe src="<%=FilterPath%>" scrolling="no" frameborder="0" width="960" height="550"
        class="details tag_details" id="ListFilterFrame"></iframe>
</div>

<script type="text/javascript">
    workflow.form.checkboxCtrl.SetupLabel();
    /* <![CDATA[ */
    jQuery('input.filter').click(function() {
        jQuery('#FilterPanel').show();
        jQuery('#TabContent1').hide();
    })
    /* ]]> */
</script>

